package com.topfun.vo;


import com.topfun.utils.DateUtil;

/**
 * Created by huangda on 2017/8/14.
 * 乐豆交易记录vo
 */
public class MarketRecord {
    // ===========================================================
    // Constants
    // ===========================================================
    public static final int STATUS_IN = 2;
    public static final int STATUS_OUT = 1;
    public static final int TYPE_NEW_USER_REWARD = 1;
    public static final int TYPE_BET = 2;
    public static final int TYPE_GRANT_PRIZE = 3;
    public static final int TYPE_CHANGE_GOODS = 6;
    public static final int TYPE_RECHARGE = 4;//充值
    // ===========================================================
    // Fields
    // ===========================================================
    public int id;
    public long userId;
    public int preAmount;
    public int amount;
    public int afterAmount;
    public int type;//1新人奖励2投注3返奖4充值5提现6商品兑换
    public int status;// 0收入    1支出
    public String description;
    public String marketTime;
    // ===========================================================
    // Constructors
    // ===========================================================
    public MarketRecord(){

    }
    public MarketRecord(User user,int amount,String description,int status,int type){
        this.preAmount = user.amount;
        this.amount = amount;
        this.afterAmount = status==STATUS_IN?user.amount + amount:user.amount - amount;
        this.userId = user.userId;
        this.description = description;
        this.marketTime = DateUtil.getDateTimeString();
        this.status = status;
        this.type = type;
    }
    // ===========================================================
    // Getter &amp; Setter
    // ===========================================================

    public int getId() {
        return id;
    }

    public long getUserId() {
        return userId;
    }

    public int getPreAmount() {
        return preAmount;
    }

    public int getAmount() {
        return amount;
    }

    public int getAfterAmount() {
        return afterAmount;
    }

    public int getType() {
        return type;
    }

    public int getStatus() {
        return status;
    }

    public String getDescription() {
        return description;
    }

    public String getMarketTime() {
        return marketTime;
    }

    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    // ===========================================================
    // Inner and Anonymous Classes
    // ===========================================================
}
